import Axios from 'axios'
import store from '@/stores/store';

const http = Axios.create()

http.interceptors.request.use(function (config) {
    if (store.state.auth.isLogined) {
        config.headers.Authorization = `Bearer ${store.state.auth.token}`;
    }
    return config
}, function (error) {
    return Promise.reject(error);
})

export default http